<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:if test="${'$'}{!empty(VALIDATION_MESSAGES.${pojoNameLower})}">
    <div class="error">
        <ul>
            <c:forEach items="${'$'}{VALIDATION_MESSAGES.${pojoNameLower}}" var="msg">
                <li><c:out value="${'$'}{msg.propertyName}"/> <c:out value="${'$'}{msg.message}"/></li>
            </c:forEach>
        </ul>
    </div>
</c:if>
<table>
    <#foreach field in pojo.getAllPropertiesIterator()>
    <#lt>   <!-- ${field.value.typeName} -->
        <#if field.equals(pojo.identifierProperty)>
            <#lt/>    <sj:hiddenfield name="${pojoNameLower}.${field.name}" htmlId="${pojoNameLower}_${field.name}" />
        <#elseif !c2h.isCollection(field) && !c2h.isManyToOne(field) && !c2j.isComponent(field) && !field.name.matches("^(created|updated)On$")>
            <#lt/>    <tr>
            <#lt/>        <th> ${util.humaniseCamelCase(field.name)} <!-- ${field.value.typeName} --></th>
            <#lt/>        <td>
            <#if field.value.typeName == "date" || field.value.typeName == "time" || field.value.typeName == "timestamp">
                <#lt/>             <sj:dateSelect name="${pojoNameLower}.${field.name}" htmlId="${pojoNameLower}_${field.name}"
                <#if field.value.typeName == "date">
                    <#lt/> mode="date"
                <#elseif field.value.typeName == "time">
                    <#lt/> mode="time"
                <#elseif field.value.typeName == "timestammp">
                    <#lt/> mode="datetime"
                </#if>
                <#lt/>/>
            <#elseif field.value.typeName == "text">
                <#lt/>            <sj:textarea name="${pojoNameLower}.${field.name}" cols="50" rows="20"
                <#lt/>                         htmlId="${pojoNameLower}_${field.name}" />
            <#elseif field.value.typeName == "boolean" || field.value.typeName == "java.lang.Boolean">
                <#lt/>            <sj:checkbox name="${pojoNameLower}.${field.name}" htmlId="${pojoNameLower}_${field.name}" />
            <#else>
                <#lt/>            <sj:textfield name="${pojoNameLower}.${field.name}" size="50" maxlength="100"
                <#lt/>                          htmlId="${pojoNameLower}_${field.name}" />
            </#if>
            <#lt/>        </td>
            <#lt/>    </tr>
        </#if>
    </#foreach>
</table>
<input type="submit" value="Save" /> or <a href="${'$'}{cancelUrl}">cancel</a>